<?php

namespace Wgx\Admin\Com\Crud;

class InvalidFieldValueException extends \Exception
{
    /** @var string */
    private $fieldName;

    /**
     * InvalidFieldValueException constructor.
     * @param string $fieldName
     * @param string $message
     * @param int $code
     * @param \Exception|null $previous
     */
    public function __construct($fieldName, $message = '', $code = 0, \Exception $previous = null)
    {
        parent::__construct($message, $code, $previous);
        $this->fieldName = $fieldName;
    }

    /**
     * @return string
     */
    public function getFieldName()
    {
        return $this->fieldName;
    }

    /**
     * @param string $fieldName
     */
    public function setFieldName($fieldName)
    {
        $this->fieldName = $fieldName;
    }
}